  <script>
function confirmDialog() {
    return confirm("ต้องการลบข้อมูลผู้ใช้งานที่เลือก ?")
}

</script>  
<script src="<?php echo base_url() ?>bootstrap/datepicker/js/bootstrap-datepicker.js"></script>
<link href="<?php echo base_url() ?>bootstrap/datepicker/css/datepicker.css" rel="stylesheet">
  <div id="page-wrapper">
            <div class="row">
            <img src="<?php echo base_url() ?>bootstrap/tot/bnnr-eservice1.jpg" class="img-responsive" alt="Responsive image">
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            ข้อมูล PON FTTx By TOT
                        </div>
                        <div class="panel panel-default">
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <form role="form" method="post" action="<? echo base_url() ?>index.php/admin/line_service/installation">    
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>ลำดับ</th>
                                            <th>รหัสลูกค้า</th>
                                            <th>หมายเลขติดตั้ง</th>
                                            <th>ชื่อสกุล</th>
                                            <th>บันทึกการติดตั้ง</th>
                                            <th>ดำเนินการ</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php
                                    $r = "<td align='center'><button type='button' class='btn btn-info btn-xs'> 
                                                <span class='glyphicon glyphicon-ok'></span> ติดตั้งเสร็จแล้ว
                                            </button></td>";
                                    $b = "<td align='center'><button type='button' class='btn btn-warning btn-xs'> 
                                                <span class='glyphicon glyphicon-refresh'></span> กำลังดำเนินการ
                                            </button></td>";
                                        $no=1;
                                        foreach($query as $rs){
                                            echo "<tr>";
                                            echo "<td>".$no."</td>";
                                            echo "<td><input type='text' class='form-control' name='cm_code' value='".$rs->cm_code."' readonly></td>";
                                            echo "<td><input type='text' class='form-control' name='cm_lineid' value='".$rs->cm_lineid."' readonly></td>";
                                            echo "<td><input type='text' class='form-control' name='cm_titlename' value='".$rs->cm_titlename."".$rs->cm_fname." ".$rs->cm_lname."' readonly></td>";

                                            if($rs->line_eq_date == '0000-00-00'){
                                                echo  "<td> <input type='text'  name='line_eq_date' class='datepicker' placeholder='วันที่ดำเนินการติดตั้ง' readonly> </td>";
                                            } else {
                                                echo "<td><input type='text' class='form-control' value='".$rs->line_eq_date."' readonly></td>";
                                            }
                                            echo "<td>"; 
                                            echo "<button type='submit'  class='btn btn-primary btn-xs'>
                                                <span class='glyphicon glyphicon-log-in'></span> บันทึกข้อมูล
                                                </button> ";          
                                            echo '</td>';
                                            echo  '</tr>';
                                            $no++;
                                        }
                                    ?>
                                    </tbody>
                                </table>
                            </form>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-6 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->

<script>
$('.datepicker').datepicker();

</script>